<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="c_rt" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fmt_rt" uri="http://java.sun.com/jstl/fmt_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"%>
<%@ taglib prefix="x_rt" uri="http://java.sun.com/jstl/xml_rt"%>
<%@ taglib prefix="wr_fn" uri="http://njo.org/taglib/functions"%>
<table width="98%">
  <tr>
    <td class="left"><a name="title"><b>编辑用户</b></a></td>
  </tr>
</table>
<form action="${pageContext.request.contextPath}/processor.saveuser.tiles" method="post">
<table class="forum" width="98%">
<col width="100"/>
<col width="*"/>
<tbody>
  <tr>
    <th colspan="2" align="left">User Properties</th>
  </tr>
  <tr>
    <td>用户名:</td>
    <td>${userInfo[0]}<input type="hidden" name="name" value="${userInfo[0]}"/></td>
  </tr>
  <tr>
    <td>密码:</td>
    <td><input type="password" name="password" value="${userInfo[1]}"/></td>
  </tr>
  <tr>
    <td>描述:</td>
    <td><input type="text" name="description" value="${userInfo[2]}"/></td>
  </tr>
</tbody>
</table>
<br/>
<table class="forum" width="98%">
<col width="10"/>
<col width="150"/>
<col width="*"/>
<tbody>
  <tr>
    <th>&nbsp;</th>
    <th>Group Name</th>
    <th>Description</th>
  </tr>
<c:forEach items="${groups}" var="item" varStatus="itemStatus">
  <tr class="${(itemStatus.index%2==0) ? 'even' : 'odd'}">
    <td><input type="checkbox" name="userGroups" value="${item[0]}" ${wr_fn:contains(item[0], userGroups) ? 'checked': ''}/></td>
    <td><a href="${pageContext.request.contextPath}/processor.loadgroup.tiles?name=${item[0]}">${item[0]}</a></td>
    <td class="left">${item[1]}</td>
  </tr>
</c:forEach>
</tbody>
</table>
<br/>
<table class="forum" width="98%">
<col width="10"/>
<col width="150"/>
<col width="*"/>
<tbody>
  <tr>
    <th>&nbsp;</th>
    <th>Role Name</th>
    <th>Description</th>
  </tr>
<c:forEach items="${roles}" var="item" varStatus="itemStatus">
  <tr class="${(itemStatus.index%2==0) ? 'even' : 'odd'}">
    <td><input type="checkbox" name="userRoles" value="${item[0]}" ${wr_fn:contains(item[0], userRoles) ? 'checked': ''}/></td>
    <td><a href="${pageContext.request.contextPath}/processor.loadrole.tiles?name=${item[0]}">${item[0]}</a></td>
    <td class="left">${item[1]}</td>
  </tr>
</c:forEach>
</tbody>
</table>
<table width="98%">
  <tr>
    <td class="right"><input type="submit" name="save" value="保存"/> <input type="reset" name="reset" value="充填"/></td>
  </tr>
</table>
</form>